<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
    <title>商品编辑页面</title>
    <link rel="stylesheet" rev="stylesheet" href="${path}/backstage/css/style.css" type="text/css" media="all"/>


    <script language="JavaScript" type="text/javascript">
        function tishi() {
            var a = confirm('数据库中保存有该人员基本信息，您可以修改或保留该信息。');
            if (a != true)return false;
            window.open("冲突页.htm", "", "depended=0,alwaysRaised=1,width=800,height=400,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0");
        }

        function check() {
            document.getElementById("aa").style.display = "";
        }

    </script>
    <style type="text/css">
        <!--
        .atten {
            font-size: 12px;
            font-weight: normal;
            color: #F00;
        }

        -->
    </style>
</head>

<body class="ContentBody">
<form action="${path}/backstage/product/edit" method="post" enctype="multipart/form-data" name="fom" id="fom" target="sypost">
    <div class="MainDiv">
        <table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
            <tr>
                <th class="tablestyle_title">商品编辑页面</th>
            </tr>
            <tr>
                <td class="CPanel">

                    <table border="0" cellpadding="0" cellspacing="0" style="width:100%">
                        <TR>
                            <TD width="100%">
                                <fieldset style="height:100%;">
                                    <legend>添加商品</legend>
                                    <table border="0" cellpadding="2" cellspacing="1" style="width:100%">
                                        <!--隐藏域：放入pid-->
                                        <input type="hidden" name="pid" id="pid" value="${product.pid}"/>
                                        <tr>
                                            <td nowrap align="right">商品编号</td>
                                            <td><input class="text" type="text" name="pNo" id="pNo"
                                                       value="${product.pNo}" readonly style="background-color: #CCCCCC"/>
                                                <%--<span class="red">*</span></td>--%>
                                            <td nowrap align="right">商品名称</td>
                                            <td><input type="text" class="text" name="pName" id="pName"
                                                       value="${product.pName}"/></td>
                                            <td nowrap align="right">规格</td>
                                            <td><input type="text" class="text" name="standard" id="standard"
                                                       value="${product.standard}"/></td>
                                        </tr>
                                        <tr>
                                            <td nowrap align="right">价格</td>
                                            <td><input type="text" class="text" name="price" id="price"
                                                       value="${product.price}"/></td>
                                            <td align="right">原价</td>
                                            <td><input type="text" class="text" name="oldPrice" id="oldPrice"
                                                       value="${product.oldPrice}"/></td>
                                            <td align="right">产地</td>
                                            <td><input type="text" class="text" name="origin" id="origin"
                                                       value="${product.origin}"/></td>
                                        </tr>
                                        <tr>
                                            <td nowrap align="right">类别</td>
                                            <td><select name="category.categoryId" id="category.categoryId">
                                                <!--迭代类别begin-->
                                                <c:forEach items="${categories}" var="c">
                                                    <option value="${c.categoryId}"
                                                            <c:if test="${c eq product.category}">selected</c:if>>${c.categoryName}</option>
                                                </c:forEach>
                                                <!--迭代类别end-->
                                            </select></td>
                                            <td align="right">上架</td>
                                            <td><select name="onShelves" id="onShelves">
                                                <option value="1" <c:if test="${product.onShelves==1}">selected</c:if>>
                                                    上架
                                                </option>
                                                <option value="0" <c:if test="${product.onShelves!=1}">selected</c:if>>
                                                    下架
                                                </option>
                                            </select></td>
                                            <td align="right">推荐类型</td>
                                            <td><select name="recState" id="recState">
                                                <!--迭代推荐类型begin-->
                                                <c:forEach items="${recStates}" var="rec">
                                                    <option value="${rec}"
                                                            <c:if test="${rec eq product.recState}">selected</c:if>>${rec}</option>
                                                </c:forEach>
                                                <!--迭代推荐类型end-->
                                            </select></td>
                                        </tr>
                                        <tr>
                                            <td nowrap align="right">库存</td>
                                            <td><input type="text" class="text" name="stock" id="stock"
                                                       value="${product.stock}"/></td>
                                            <td nowrap align="right">商品图片</td>
                                            <td><input type="file" name="file" id="file"/></td>
                                        </tr>
                                        <tr>
                                            <td colspan="3"><img src="${path}/images/product/${product.imgUrl}" alt="" name="imgUrl" id="imgUrl"></td>
                                        </tr>
                                    </table>
                                    <br/>
                                </fieldset>
                            </TD>
                        </TR>

                    </TABLE>


                </td>
            </tr>


            <TR>
                <TD colspan="2" align="center" height="50px">
                    <input type="submit" name="Submit" value="保存" class="button"/>
                    <input type="button" name="Submit2" value="返回" class="button" onclick="window.history.go(-1);"/>
                </TD>
            </TR>
        </TABLE>


        </td>
        </tr>


        </table>

    </div>
</form>
</body>
</html>
